# import numpy as np
# import random
# import time
# random_list1 = np.random.randint(1, 101, size=10)
# random_list2 = np.random.randint(1, 1001, size=100)
# random_list3 = np.random.randint(1, 10001, size=1000)
# random_list4 = np.random.randint(1, 100001, size=10000)
# list1=[random_list1,random_list2,random_list3,random_list4]
#
#
# import random
# import string
# # 生成包含随机字母和数字的字符串，长度为10
# random_string1 = ''.join(random.choices(string.ascii_letters + string.digits, k=10))
# # 生成包含随机字母的字符串，长度为5
# random_string2 = ''.join(random.choices(string.ascii_letters + string.digits, k=5))
#
import numpy as np
import random
import time
import string
class generator:
    def __init__(self, num = 5, length = 100, begin = 0, step = 50,choice = 0) ->None:
        self.array1 = []
        self.array = []
        self.num = num
        self.length = length
        if choice == 0:
            for i in range(num):
                array1 = []
                for i in range(length):
                    temp = np.random.randint(begin , begin+step)
                    array1.append(temp)
                    begin = np.random.choice(array1)
                array = [i for i in array1]
                np.random.shuffle(array)
                seeds = int(time.time())
                np.random.seed(seeds)
                self.array.append(array)
                begin = np.random.choice(array1)
        elif choice == 1:
            for i in range(1,num+1):
                array1 = []
                for _ in range(i):
                    temp = np.random.randint(begin , begin+step)
                    array1.append(temp)
                    begin = np.random.choice(array1)
                array = [i for i in array1]
                np.random.shuffle(array)
                seeds = int(time.time())
                np.random.seed(seeds)
                self.array.append(array)
                begin = np.random.choice(array1)
    def __str__(self) -> str:
        test_str = "Test set is:\n"
        for i in range(self.num):
            test_str += str(self.array[i]) + '\n'
        return test_str

    def __getitem__(self, index):
        return self.array[index]
    def __len__(self):
        return len(self.array)

def strr(m,n):
    random_string1 = ''.join(random.choices(string.ascii_letters + string.digits, k=m))
    random_string2 = ''.join(random.choices(string.ascii_letters + string.digits, k=n))
    return [random_string1,random_string2]
if __name__ == "__main__":
    temp = [20,30,40]
    b = generator(length=temp[0])
    for i in range(len(temp)):
        b = generator(length=temp[0])
    print(type(b))